<script type="text/javascript" src="<?=site_url()?>js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?=site_url()?>js/jquery-ui-1.8.custom.min.js"></script>
<script type="text/javascript" src="<?=site_url()?>js/jquery.ui.datepicker-th.js"></script>
<script type='text/javascript' src='<?=site_url()?>js/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='<?=site_url()?>js/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='<?=site_url()?>js/jquery.autocomplete.js'></script>
<script type='text/javascript' src='<?=site_url()?>js/localdata.js'></script>
<link type="text/css" href="<?=site_url()?>js/ui/themes/start/jquery.ui.all.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="<?=site_url()?>css/jquery.autocomplete.css" />
<script type="text/javascript" src="<?=site_url()?>js/punvalidate.js"></script>
<style>
.ui-datepicker {
	width: 15em;
}
.ui-widget {
	font-size: 10pt;
}
.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
	width: 60px;
}
</style>
<script language="javascript">
	$().ready(function() {
		$("#txtBirthday").datepicker({
			showOn: 'button',
			buttonImage: '<?=site_url()?>images/calbtn.gif',
			buttonImageOnly: true,
			changeMonth: true,
			changeYear: true,
			yearRange: 'c-45:c'
		});	
		$("#txtProvince").autocomplete(provinces, {
			minChars: 0,
			max: 20,
			autoFill: false,
			mustMatch: false,
			matchContains: false,
			scrollHeight: 100,
			formatItem: function(data, i, total) {
				return data[0];
			}
		});	
	
		$("#txtArea").autocomplete(areas, {
			minChars: 0,
			max: 20,
			autoFill: false,
			mustMatch: false,
			matchContains: false,
			scrollHeight: 100,
			formatItem: function(data, i, total) {
				return data[0];
			}
		});	
	
		$("#txtDistinct").autocomplete(distincts, {
			minChars: 0,
			max: 20,
			autoFill: false,
			mustMatch: false,
			matchContains: false,
			scrollHeight: 100,
			formatItem: function(data, i, total) {
				return data[0];
			}
		});	
	
		$("#txtRoad").autocomplete(road, {
			minChars: 0,
			max: 20,
			autoFill: false,
			mustMatch: false,
			matchContains: false,
			scrollHeight: 100,
			formatItem: function(data, i, total) {
				return data[0];
			}
		});	
});
	function handleTitle(val) {
		if(val.value == "อื่นๆ") {
			document.getElementById("txtTitleOther").readOnly = false;
			document.getElementById("txtTitleOther").className = "";
			document.getElementById("txtTitleOther").focus();
		} else {
			document.getElementById("txtTitleOther").readonly = true;
			document.getElementById("txtTitleOther").className = "textReadonly";
			document.getElementById("txtTitleOther").value = "";
		}
	}
	function handleCurrentClass(obj) {
		if(obj.value == "สูงกว่า ป. ตรี (โปรดระบุ)") {		
			document.getElementById('txtCurrentClassOther').style.visibility="visible";
			document.getElementById('txtCurrentClassOther').focus();
		} else {
			document.getElementById('txtCurrentClassOther').style.visibility="hidden";
			document.getElementById('txtCurrentClassOther').value = '';
		}
	}
	function checkImageExt(obj) {
		var t = obj.value;
		var txt = obj.value.substring(obj.value.lastIndexOf(".")+1).toLowerCase();
		if(!(txt == "jpg" || txt == "jpeg" || txt == "gif" || txt == "png" || txt == "pdf")) {
			alert("ไฟล์รูปภาพที่แนบมาไม่ถูกต้อง " + t + "\nกรุณาเลือกไฟล์ใหม่");	
		}
	}
	
	function handleCouse(obj) {
		if(obj.value == "อื่นๆ (โปรดระบุ)") {		
			document.getElementById('txtCourseOther').style.visibility="visible";
			document.getElementById('txtCourseOther').style.width="100px";
			document.getElementById('txtCourseOther').focus();
		} else {
			document.getElementById('txtCourseOther').style.visibility="hidden";
			document.getElementById('txtCourseOther').style.width="1px";
			document.getElementById('txtCourseOther').value = '';
		}
	}
	
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}

	function handleNetwork(obj) {
		var txt = 'txtNetMobile' + obj.id.substring(obj.id.length - 2);
			if(obj.value == "อื่นๆ (โปรดระบุ)") {
				document.getElementById(txt).style.visibility="visible";
				document.getElementById(txt).focus();
			} else {
				document.getElementById(txt).style.visibility="hidden";
				document.getElementById(txt).value = '';
			}
		}
	function validateForm() {
		if(trim(document.getElementById('txtFirstName').value).length == 0) {
			document.getElementById('txtFirstName').focus();
			alert("กรุณาใส่ชื่อ (ภาษาไทย)");
			return;		
		} else if(trim(document.getElementById('txtLastName').value).length == 0) {
			document.getElementById('txtLastName').focus();
			alert("กรุณาใส่นามสกุล (ภาษาไทย)");
			return;		
		} else if(trim(document.getElementById('txtNickName').value).length == 0) {
			document.getElementById('txtNickName').focus();
			alert("กรุณาใส่ชื่อเล่น");
			return;		
		} else if(trim(document.getElementById('txtBirthday').value).length == 0) {
			document.getElementById('txtBirthday').focus();
			alert("กรุณาใส่วัน เดือน ปี เกิด");
			return;		
		} else if(trim(document.getElementById('txtSchool').value).length == 0) {
			document.getElementById('txtSchool').focus();
			alert("กรุณาใส่ชื่อโรงเรียน");
			return;		
		} 
		if(trim(document.getElementById('txtEmail').value).length == 0) {
			document.getElementById('txtEmail').focus();
			alert('กรุณาใส่อีเมล์');
			return;
		}
		if(trim(document.getElementById('txtEmail').value).length > 0 && isValidEmailAddress(document.getElementById('txtEmail').value) == false) {
			document.getElementById('txtEmail').focus();
			alert('รูปแบบอีเมล์ไม่ถูกต้อง');
			return;
		}
		if(trim(document.getElementById('txtTel').value).length > 0 && isTelNo(document.getElementById('txtTel').value) == false) {
			document.getElementById('txtTel').focus();
			alert("รูปแบบเบอร์โทรศัพท์ไม่ถูกต้อง");
			return;		
		}
		if(trim(document.getElementById('txtMobile01').value).length == 0) {
			document.getElementById('txtMobile01').focus();
			alert('กรุณาใส่เบอร์โทรศัพท์มือถือ');
			return;
		}
		if(trim(document.getElementById('txtMobile01').value).length > 0 && isTelNo(document.getElementById('txtMobile01').value) == false) {
			document.getElementById('txtMobile01').focus();
			alert("รูปแบบเบอร์โทรศัพท์ไม่ถูกต้อง");
			return;		
		}
		if(trim(document.getElementById('txtMobile02').value).length > 0 && isTelNo(document.getElementById('txtMobile02').value) == false) {
			document.getElementById('txtMobile02').focus();
			alert("รูปแบบเบอร์โทรศัพท์ไม่ถูกต้อง");
			return;		
		} 
		if(trim(document.getElementById('txtDistinct').value).length == 0) {
			document.getElementById('txtDistinct').focus();
			alert('กรุณาใส่ที่อยู่');
			return;
		}
		if(trim(document.getElementById('txtArea').value).length == 0) {
			document.getElementById('txtArea').focus();
			alert('กรุณาใส่ที่อยู่');
			return;
		}
		document.forms["myForm"].submit();
	}
</script>
<table width="915" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr>
        <td width="86" height="1596"><img src="<?=site_url()?>images/registerstudy_14.jpg" width="86" height="2500" alt="" /></td>
        <td width="739" valign="top" bgcolor="#FFFFFF"><table width="739" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="618"><img src="<?=site_url()?>images/registerstudy_16.jpg" width="617" height="108" alt="" /></td>
            <td width="121" height="108"><img src="<?=site_url()?>images/registerstudy_17.jpg" width="121" height="108" alt="" /></td>
          </tr>
          <tr>
            <td height="84" background="<?=site_url()?>images/registerstudy_19.jpg"colspan="2"><table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><p><span class="style2"><img src="<?=site_url()?>images/buttomaward_19.jpg" width="90" height="15" />สถาบันกวดวิชาคุณภาพโดยทีมติวเตอร์มืออาชีพ  ขอโอกาสที่จะเสนอรูปแบบการเรียนรู้ใหม่ๆ ให้กับน้องๆ<br> ด้วยจุดเด่นต่างๆ ดังนี้ </span></p></td>
              </tr>
            </table></td>
            </tr>
          <tr>
            <td height="255" colspan="2"><img src="<?=site_url()?>images/registerstudy_20.jpg" width="739" height="255" alt="" /></td>
            </tr>
          <tr>
            <td height="46" colspan="2"><img src="<?=site_url()?>images/registerstudy_21.jpg" width="730" height="46" alt="" /><a name="process">&nbsp;</a> </td>
            </tr>
          <tr>
            <td height="912" colspan="2"><table id="Table_01" width="740" height="913" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td colspan="7"><img src="<?=site_url()?>images/registerstudy_22_01.jpg" width="739" height="200" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="200" alt="" /></td>
              </tr>
              <tr>
                <td><img src="<?=site_url()?>images/registerstudy_22_02.jpg" width="45" height="60" alt="" /></td>
                <td colspan="2"><img src="<?=site_url()?>images/registerstudy_22_03.jpg" width="44" height="39" alt="" /></td>
                <td colspan="2"><p class="style2">น้องๆ  กรอกแบบฟอร์มการจองเวลาเรียนในหน้านี้ <br />
                  หรือสมัครด้วยตนเองที่สถาบัน </p></td>
                <td colspan="2"><p class="style2">ทางสถาบันคัดเลือกติวเตอร์ที่เหมาะสมกับน้องๆแต่ละคน <br />
                  เพื่อประสิทธิภาพการสอนที่ดีที่สุด </p></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="39" alt="" /></td>
              </tr>
              <tr>
                <td colspan="4"><a href="contact.html#map" target="_self" onmouseover="MM_swapImage('Image65','','<?=site_url()?>images/registerstudyroll_22_06.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="<?=site_url()?>images/registerstudy_22_06.jpg" name="Image65" width="183" height="24" border="0" id="Image65" /></a></td>
                <td colspan="3"><img src="<?=site_url()?>images/registerstudy_22_07.jpg" width="556" height="24" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="24" alt="" /></td>
              </tr>
              <tr>
                <td colspan="7"><img src="<?=site_url()?>images/registerstudy_22_08.jpg" width="739" height="268" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="293" alt="" /></td>
              </tr>
              <tr>
                <td colspan="2" rowspan="5"><img src="<?=site_url()?>images/registerstudy_22_09.jpg" width="86" height="133" alt="" /></td>
                <td colspan="4"><p class="style2">ทางสถาบันส่งใบเสร็จกลับไปทางอีเมล <br />
                  หรือทางแฟกซ์ </p></td>
                <td rowspan="3" valign="top"><p><span class="style2">เมื่อสถาบันยืนยันการนัดติวเตอร์ทางโทรศัพท์แล้ว  น้องๆ <br />
                  สามารถชำระเงินได้ด้วยตนเองได้ที่สถาบันหรือชำระเงิน<br />
                  โดยโอนเข้าบัญชี</span></p></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="20" alt="" /></td>
              </tr>
              <tr>
                <td colspan="4"><br/><a href="<?=site_url()?>data-image/file_management/<?=$banner['file_name']?>" target="_blank" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image66','','<?=site_url()?>images/registerstudyroll_22_12.jpg',1)"><img src="<?=site_url()?>images/registerstudy_22_12.jpg" name="Image66" width="334" height="22" border="0" id="Image66" /></a></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="22" alt="" /></td>
              </tr>
              <tr>
                <td colspan="4" rowspan="3"><br/><img src="<?=site_url()?>images/registerstudy_22_13.jpg" width="334" height="91" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="18" alt="" /></td>
              </tr>
              <tr valign="top">
                <td valign="top"><a href="payment.html" target="_self" onmouseover="MM_swapImage('Image64','','<?=site_url()?>images/registerstudyroll_22_14.jpg',1)" onmouseout="MM_swapImgRestore()"><img src="<?=site_url()?>images/registerstudy_22_14.jpg" name="Image64" width="319" height="24" border="0" id="Image64" /></a></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="24" alt="" /></td>
              </tr>
              <tr>
                <td><img src="<?=site_url()?>images/registerstudy_22_15.jpg" width="319" height="49" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="49" alt="" /></td>
              </tr>
              <tr>
                <td colspan="7"><img src="<?=site_url()?>images/registerstudy_22_16.jpg" width="739" height="197" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="1" height="197" alt="" /></td>
              </tr>
              <tr>
                <td><img src="<?=site_url()?>images/spacer.gif" width="45" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="41" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="3" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="94" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="226" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="11" height="1" alt="" /></td>
                <td><img src="<?=site_url()?>images/spacer.gif" width="319" height="1" alt="" /></td>
                <td></td>
              </tr>
            </table></td>
            </tr>
          <tr>
            <td height="120" colspan="2" bgcolor="#FFFFFF"><table width="587" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="359"><p class="style1"><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;พี่ๆ ติวเตอร์  ไปสอนน้องตามเวลาและ<br />
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;สถานที่ที่นัดหมาย </span></p></td>
                <td width="228"><p class="style2">น้องๆ  สามารถตกลงเวลาและสถานที่<br>กับพี่ๆ ติวเตอร์ได้เอง หลังชั่วโมงแรก </p></td>
              </tr>
              <tr>
                <td colspan="2">&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2"><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;หมายเหตุ : • หากน้องๆ ไม่ชอบสไตล์การสอนของติวเตอร์  ทางสถาบัน</span><span class="blue">ยินดีเปลี่ยนติวเตอร์ใหม่ทันที  <br />
                </span><span class="style2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;เพื่อการเรียนการสอนที่มีประสิทธิภาพสูงสุด <br />
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;• </span><span class="blue">น้องๆ  ยังไม่ต้องชำระเงิน</span><span class="style2">จนกว่าทางสถาบันยืนยันการคัดเลือกติวเตอร์ที่ตรงกับความต้องการของน้องๆ <br />
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  ตอนนี้แค่กรอกแบบฟอร์มการจองเวลาเรียนด้านล่างก็พอค่ะ</span></td>
              </tr>
              <tr>
                <td colspan="2">
                <form name="myForm" id="myForm" enctype="multipart/form-data" method="post" action="<?=site_url()?>register_study/save" onsubmit="return validateForm();">
        <table width="739" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td width="739" height="202"><table id="Table_01" width="739" height="202" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td><img src="<?=site_url()?>images/registerstudy_increase_19_01.jpg" width="739" height="83" alt="" /></td>
              </tr>
              <tr>
                <td><table id="Table_7" width="739" height="80" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><img src="<?=site_url()?>images/registerstudy_increase_19_02_01.jpg" width="739" height="30" alt="" /></td>
                  </tr>
                  <tr>
                    <td background="<?=site_url()?>images/registerstudy_increase_19_02_02.jpg">
                    <table border="0" cellspacing="1" cellpadding="1" class="styleLabel">
                  <col width="180px" />
                  <col width="*" />
                  <col width="100px" />
                  <tr>
                    <td align="right"><label>คำนำหน้าชื่อ</label></td>
                    <td align="left"><input name="radTitle" type="radio" id="radTitle1" value="นาย" <?php if($form_status == 'add' || (isset($title) && $title == 'นาย')) echo 'checked="checked"'; ?> onclick="handleTitle(this);" />
                      นาย
                      <input type="radio" name="radTitle" id="radTitle2" value="นาง" <?php if($form_status != 'add' && (isset($title) && $title == 'นาง')) echo 'checked="checked"'; ?> onclick="handleTitle(this);"/>
                      นาง
                      <input type="radio" name="radTitle" id="radTitle3" value="นางสาว" <?php if($form_status != 'add' && (isset($title) && $title == 'นางสาว')) echo 'checked="checked"'; ?> onclick="handleTitle(this);"/>
                      นางสาว
                      <input type="radio" name="radTitle" id="radTitle4" value="ด.ช." <?php if($form_status != 'add' && (isset($title) && $title == 'ด.ช.')) echo 'checked="checked"'; ?> onclick="handleTitle(this);"/>
                      ด.ช. 
                      <input type="radio" name="radTitle" id="radTitle5" value="ด.ญ." <?php if($form_status != 'add' && (isset($title) && $title == 'ด.ญ.')) echo 'checked="checked"'; ?> onclick="handleTitle(this);"/>
                      ด.ญ.
                      <input type="radio" name="radTitle" id="radTitle6" value="อื่นๆ" <?php if($form_status == 'add' || (isset($title) && ($title == 'นาย' || $title == 'นาง' || $title == 'นางสาว' || $title == 'ด.ช.' || $title == 'ด.ญ.'))) echo ''; else echo 'checked="checked"';?> onclick="handleTitle(this);"/>
                      อื่นๆ
                      <input name="txtTitleOther" type="text" id="txtTitleOther" style="width:90px;" <?php if($form_status == 'add' || (isset($title) && ($title == 'นาย' || $title == 'นาง' || $title == 'นางสาว' || $title == 'ด.ช.' || $title == 'ด.ญ.'))) echo 'readonly="readonly" class="textReadonly"'; else echo ' value="'.$title.'"';?>  />
                    </td>
                  </tr>
                  <tr>
                    <td align="right">ชื่อ</td>
                    <td align="left"><input name="txtFirstName" id="txtFirstName" type="text" maxlength="45" value="<?php if($form_status != 'add' && (isset($first_name))) echo $first_name; ?>" />
                        <span class="red">*</span>
                         นามสกุล 
                        <input name="txtLastName" id="txtLastName" type="text" maxlength="45" value="<?php if($form_status != 'add' && (isset($last_name))) echo $last_name; ?>"/>
                      <span class="red">*</span>  </td>
                  </tr>
                  <tr>
                    <td align="right">ชื่อเล่น</td>
                    <td align="left"> 
                        <input name="txtNickName" id="txtNickName" type="text" maxlength="45" value="<?php if($form_status != 'add' && (isset($nick_name))) echo $nick_name; ?>"/>
                      <span class="red">*</span> 
                    </td>
                  </tr>
                  <tr>
                    <td align="right"><label>วัน เดือน ปีเกิด</label></td>
                    <td align="left"><input name="txtBirthday" type="text" class="textReadonly" id="txtBirthday"  readonly="readonly" value="<?php if($form_status != 'add' && (isset($birthday))) echo $birthday; ?>"/><span class="red">*</span> 
                         <label>ชั้น</label>                     
                        <select name="txtCurrentClass" id="txtCurrentClass" onchange="handleCurrentClass(this);">
                          <option value="ต่ำกว่า อ. 1" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ต่ำกว่า อ. 1') echo 'selected="selected"';?>>ต่ำกว่า อ. 1</option>
                          <option value="อ. 1" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'อ. 1') echo 'selected="selected"';?>>อ. 1</option>
                          <option value="อ. 2" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'อ. 2') echo 'selected="selected"';?>>อ. 2</option>
                          <option value="อ. 3" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'อ. 3') echo 'selected="selected"';?>>อ. 3</option>
                          <option value="ป. 1" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 1') echo 'selected="selected"';?>>ป. 1</option>
                          <option value="ป. 2" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 2') echo 'selected="selected"';?>>ป. 2</option>
                          <option value="ป. 3" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 3') echo 'selected="selected"';?>>ป. 3</option>
                          <option value="ป. 4" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 4') echo 'selected="selected"';?>>ป. 4</option>
                          <option value="ป. 5" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 5') echo 'selected="selected"';?>>ป. 5</option>
                          <option value="ป. 6" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ป. 6') echo 'selected="selected"';?>>ป. 6</option>
                          <option value="ม. 1" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ม. 1') echo 'selected="selected"';?>>ม. 1</option>
                          <option value="ม. 2" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ม. 2') echo 'selected="selected"';?>>ม. 2</option>
                          <option value="ม. 3" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ม. 3') echo 'selected="selected"';?>>ม. 3</option>
                          <option value="ม. 4" <?php if($form_status == 'add' || $current_class == 'ม. 4') echo 'selected="selected"';?> >ม. 4</option>
                          <option value="ม. 5" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ม. 5') echo 'selected="selected"';?>>ม. 5</option>
                          <option value="ม. 6" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ม. 6') echo 'selected="selected"';?>>ม. 6</option>
                          <option value="ปี 1" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ปี 1') echo 'selected="selected"';?>>ปี 1</option>
                          <option value="ปี 2" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ปี 2') echo 'selected="selected"';?>>ปี 2</option>
                          <option value="ปี 3" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ปี 3') echo 'selected="selected"';?>>ปี 3</option>
                          <option value="ปี 4" <?php if($form_status != 'add' && isset($current_class) && $current_class == 'ปี 4') echo 'selected="selected"';?>>ปี 4</option>
                          <option value="สูงกว่า ป. ตรี (โปรดระบุ)" <?php if($form_status != 'add' && isset($current_class) && $current_class != 'ต่ำกว่า อ. 1' && $current_class != 'อ. 1' && $current_class != 'อ. 2' && $current_class != 'อ. 3' && $current_class != 'ป. 1' && $current_class != 'ป. 2' && $current_class != 'ป. 3' && $current_class != 'ป. 4' && $current_class != 'ป. 5' && $current_class != 'ป. 6' && $current_class != 'ม. 1' && $current_class != 'ม. 2' && $current_class != 'ม. 3' && $current_class != 'ม. 4' && $current_class != 'ม. 5' && $current_class != 'ม. 6' && $current_class != 'ปี 1' && $current_class != 'ปี 2' && $current_class != 'ปี 3' && $current_class != 'ปี 4') echo 'selected="selected"';?>>สูงกว่า ป. ตรี (โปรดระบุ)</option>
                        </select>
                        <span class="require">
                        <input name="txtCurrentClassOther" id="txtCurrentClassOther" size="15" type="text" maxlength="45" <?php if($form_status != 'add' && isset($current_class) && $current_class != 'ต่ำกว่า อ. 1' && $current_class != 'อ. 1' && $current_class != 'อ. 2' && $current_class != 'อ. 3' && $current_class != 'ป. 1' && $current_class != 'ป. 2' && $current_class != 'ป. 3' && $current_class != 'ป. 4' && $current_class != 'ป. 5' && $current_class != 'ป. 6' && $current_class != 'ม. 1' && $current_class != 'ม. 2' && $current_class != 'ม. 3' && $current_class != 'ม. 4' && $current_class != 'ม. 5' && $current_class != 'ม. 6' && $current_class != 'ปี 1' && $current_class != 'ปี 2' && $current_class != 'ปี 3' && $current_class != 'ปี 4') echo 'value="'.$current_class.'"'; else echo 'style="visibility:hidden;"'; ?>/>
                        </span></td>
                  </tr>
                  <tr>
                    <td align="right">โรงเรียน</td>
                    <td align="left"><input name="txtSchool" id="txtSchool" type="text"  maxlength="45" <?php if($form_status != 'add' && isset($school)) echo 'value="'.$school.'"';?>/>  
                    <span class="red">*</span> 
        <label>แผนการเรียน(ถ้ามี)</label> <input name="txtPlan" id="txtPlan" type="text"  maxlength="45" <?php if($form_status != 'add' && isset($plan_edu)) echo 'value="'.$plan_edu.'"';?>/>          
                  </td>
                  </tr>
                  <tr>
                    <td align="right">หลักสูตร</td>
                    <td align="left">
                      <select name="txtCourse" id="txtCourse" onchange="handleCouse(this);">
                        <option value="ภาษาไทย" <?php if($form_status == 'add' || $course_type == 'ภาษาไทย') echo 'selected="selected"';?>>ภาษาไทย</option>
                        <option value="นานาชาติ" <?php if($form_status != 'add' && isset($course_type) && $course_type == 'นานาชาติ') echo 'selected="selected"';?>>นานาชาติ</option>
                        <option value="อื่นๆ (โปรดระบุ)" <?php if($form_status != 'add' && isset($course_type) && $course_type != 'ภาษาไทย' &&  $course_type != 'นานาชาติ') echo 'selected="selected"';?>>อื่นๆ (โปรดระบุ)</option>
                    </select>
                      <span class="red">
                      <input name="txtCourseOther" id="txtCourseOther" type="text" maxlength="45" <?php if($form_status != 'add' && isset($course_type) && $course_type != 'ภาษาไทย' &&  $course_type != 'นานาชาติ') echo 'value="'.$course_type.'"'; else echo 'style="visibility:hidden;width:1px;"'; ?> />
                    </span>  <label>เลขที่บัตรประชาชน</label> <input name="txtCitizenId" id="txtCitizenId" type="text" maxlength="30" <?php if($form_status != 'add' && isset($citizen_id)) echo 'value="'.$citizen_id.'"';?> />
                    </td>
                  </tr>
                   <tr style="height: 10px;">
                     <td align="right"></td>
                     <td align="left"></td>
                   </tr>
          </table>
                    
                    </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><img src="<?=site_url()?>images/registerstudy_increase_19_03.jpg" width="739" height="39" alt="" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td ><table id="Table_" width="739" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="739" height="71" background="<?=site_url()?>images/registerstudy_increase_20_01.jpg">
                <br/><br/>
				</td>
              </tr>
              <tr>
                <td><table id="Table_6" width="739" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td><img src="<?=site_url()?>images/registerstudy_increase_20_02_01.jpg" width="739" height="44" alt="" /></td>
                  </tr>
                  <tr>
                    <td background="<?=site_url()?>images/registerstudy_increase_20_02_02.jpg">
                    <table border="0" cellspacing="1" cellpadding="1" class="styleLabel">
                  <col width="180px" />
                  <col width="*" />
                  <tr>
                    <td align="right">อีเมล์</td>
                    <td align="left"><input name="txtEmail" type="text" id="txtEmail" maxlength="45" value="<?php if(isset($email)) echo $email; ?>" /><span class="red">*</span> 
                    โทรศัพท์ที่บ้าน <input name="txtTel" type="text" id="txtTel" maxlength="20" value="<?php if(isset($telephone_home)) echo $telephone_home; ?>" /></td>
                  </tr>
                  <tr>
                    <td align="right">โทรศัพท์มือถือ</td>
                    <td align="left">1. <input name="txtMobile01" type="text" id="txtMobile01" maxlength="20" style="width:140px" value="<?php if(isset($mobile01)) echo $mobile01; ?>" /><span class="red">*</span>  
                      เครือข่าย
                      <select name="selNetMobile01" id="selNetMobile01" onchange="handleNetwork(this);">
                        <option value="AIS" <?php if(isset($mobile01_network) == false || $mobile01_network == 'AIS') echo 'selected="selected"';?>>AIS</option>
                        <option value="DTAC" <?php if(isset($mobile01_network)  && $mobile01_network == 'DTAC') echo 'selected="selected"';?>>DTAC</option>
                        <option value="True Move" <?php if(isset($mobile01_network)  && $mobile01_network == 'True Move') echo 'selected="selected"';?>>True Move</option>
                        <option value="Hutch" <?php if(isset($mobile01_network)  && $mobile01_network == 'Hutch') echo 'selected="selected"';?>>Hutch</option>
                        <option value="ไม่ทราบ" <?php if(isset($mobile01_network)  && $mobile01_network == 'ไม่ทราบ') echo 'selected="selected"';?>>ไม่ทราบ</option>
                        <option value="อื่นๆ (โปรดระบุ)" <?php if(isset($mobile01_network) && $mobile01_network != 'AIS' && $mobile01_network != 'DTAC' && $mobile01_network != 'True Move'  && $mobile01_network != 'Hutch' && $mobile01_network != 'ไม่ทราบ') echo 'selected="selected"';?>>อื่นๆ (โปรดระบุ)</option>
                      </select>
                      <input name="txtNetMobile01" type="text" id="txtNetMobile01"  style="visibility:hidden;width:75px;" maxlength="10"  />
                  	</td>
                  	</tr>
                  	<tr>
                  	<td>&nbsp;</td>
                  	<td>
                      2.
                      <input name="txtMobile02" type="text" id="txtMobile02"  style="width:140px" value="<?php if(isset($mobile02)) echo $mobile02; ?>" />
                   &nbsp;&nbsp;เครือข่าย
                      <select name="selNetMobile02" id="selNetMobile02"  onchange="handleNetwork(this);">
                        <option value="AIS" <?php if(isset($mobile02_network) == false || $mobile02_network == 'AIS') echo 'selected="selected"';?>>AIS</option>
                        <option value="DTAC" <?php if(isset($mobile02_network)  && $mobile02_network == 'DTAC') echo 'selected="selected"';?>>DTAC</option>
                        <option value="True Move" <?php if(isset($mobile02_network)  && $mobile02_network == 'True Move') echo 'selected="selected"';?>>True Move</option>
                        <option value="Hutch" <?php if(isset($mobile02_network)  && $mobile02_network == 'Hutch') echo 'selected="selected"';?>>Hutch</option>
                        <option value="ไม่ทราบ" <?php if(isset($mobile02_network)  && $mobile02_network == 'ไม่ทราบ') echo 'selected="selected"';?>>ไม่ทราบ</option>
                        <option value="อื่นๆ (โปรดระบุ)" <?php if(isset($mobile02_network) && $mobile02_network != 'AIS' && $mobile02_network != 'DTAC' && $mobile02_network != 'True Move'  && $mobile02_network != 'Hutch' && $mobile02_network != 'ไม่ทราบ') echo 'selected="selected"';?>>อื่นๆ (โปรดระบุ)</option>
                      </select>
                      <input name="txtNetMobile02" type="text" id="txtNetMobile02" style="visibility:hidden;width:75px;" maxlength="10"/>
                              </td>
                  </tr>
                  <tr>
                    <td align="right">ที่อยู่<span class="red">*</span></td>
                    <td align="left">เลขที่่ห้องพัก
                          <input name="txtRoomNo" type="text" id="txtRoomNo" size="9" maxlength="10" value="<?php if(isset($add_room_no)) echo $add_room_no; ?>" />
บ้านเลขที่
<input name="txtHomeNo" type="text" id="txtHomeNo" size="11" maxlength="10" value="<?php if(isset($add_home_no)) echo $add_home_no; ?>" />
</tr>
<tr>
<td>&nbsp;</td>
<td>
ชื่ออาคาร/คอนโดมิเนียม
<input name="txtBuilding" type="text" id="txtBuilding" style="width:190px;" maxlength="45" value="<?php if(isset($add_building_name)) echo $add_building_name; ?>" />
</tr>
<tr>
<td>&nbsp;</td>
<td>
หมู่ที่
<input name="txtMoo" type="text" id="txtMoo" size="3" maxlength="10" value="<?php if(isset($add_moo)) echo $add_moo; ?>" />
ซอย
<input name="txtSoi" type="text" id="txtSoi" style="width:130px;" maxlength="45" value="<?php if(isset($add_soi)) echo $add_soi; ?>" />
ถนน <input name="txtRoad" type="text" id="txtRoad" maxlength="45"  />
</tr>
<tr>
<td>&nbsp;</td>
<td>
แขวง <input name="txtDistinct" type="text" id="txtDistinct" style="width:130px;" maxlength="45" value="<?php if(isset($add_district)) echo $add_district; ?>" />
เขต <input name="txtArea" type="text" id="txtArea" style="width:130px;" maxlength="45" value="<?php if(isset($add_area)) echo $add_area; ?>" /> 
</tr>
<tr>
<td>&nbsp;</td>
<td> จังหวัด <input name="txtProvince" type="text" id="txtProvince" style="width:100px;" maxlength="45" value="<?php if(isset($add_province)) echo $add_province; ?>" /> รหัสไปรษณีย์
<input name="txtPostCode" type="text" id="txtPostCode" size="12" maxlength="6" value="<?php if(isset($add_post_code)) echo $add_post_code; ?>" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td> ข้อมูลอื่นๆ เช่น จุดสังเกตใกล้เคียง
<input name="txtAddNote" type="text" id="txtAddNote" size="30" maxlength="100" /></td>
</tr>

                  <tr>
                    <td align="right" >แนบแผนที่</td>
                    <td align="left"><input name="txtMap" id="txtMap" type="file" onchange="checkImageExt(this);" /></td>
                  </tr>
                  <tr>
                    <td align="right" ><label>ชื่อผู้กรอกข้อมูล</label></td>
                    <td align="left">(<span class="style1">กรณีที่นักเรียนไม่ได้กรอกด้วยตนเอง</span>)</td>
                  </tr>
                  <tr>
                    <td align="right" ><label>ชื่อ</label></td>
                    <td align="left"><input name="txtWFName" type="text" id="txtWFName" value="<?php if(isset($first_name_writer)) echo $first_name_writer; ?>" />
                      <label> นามสกุล </label>
                      <input name="txtWLName" type="text" id="txtWLName" value="<?php if(isset($last_name_writer)) echo $last_name_writer; ?>" /></td>
                  </tr>
                  <tr>
                    <td align="right" ><label>โทรศัพท์มือถือ</label></td>
                    <td align="left"><input name="txtWMobile" type="text" id="txtWMobile" value="<?php if(isset($telephone_writer)) echo $telephone_writer; ?>" />
                      เครือข่าย
                        <select name="selNetMobile03" id="selNetMobile03"  onchange="handleNetwork(this);">
	                          <option value="AIS" <?php if(isset($telephone_network) == false || $telephone_network == 'AIS') echo 'selected="selected"';?>>AIS</option>
	                        <option value="DTAC" <?php if(isset($telephone_network)  && $telephone_network == 'DTAC') echo 'selected="selected"';?>>DTAC</option>
	                        <option value="True Move" <?php if(isset($telephone_network)  && $telephone_network == 'True Move') echo 'selected="selected"';?>>True Move</option>
	                        <option value="Hutch" <?php if(isset($telephone_network)  && $telephone_network == 'Hutch') echo 'selected="selected"';?>>Hutch</option>
	                        <option value="ไม่ทราบ" <?php if(isset($telephone_network)  && $telephone_network == 'ไม่ทราบ') echo 'selected="selected"';?>>ไม่ทราบ</option>
	                        <option value="อื่นๆ (โปรดระบุ)" <?php if(isset($telephone_network) && $telephone_network != 'AIS' && $telephone_network != 'DTAC' && $telephone_network != 'True Move'  && $telephone_network != 'Hutch' && $telephone_network != 'ไม่ทราบ') echo 'selected="selected"';?>>อื่นๆ (โปรดระบุ)</option>
                        </select>
                    <input name="txtNetMobile03" type="text" id="txtNetMobile03" <?php if(!(isset($telephone_network) && $telephone_network != 'AIS' && $telephone_network != 'DTAC' && $telephone_network != 'True Move'  && $telephone_network != 'Hutch' && $telephone_network != 'ไม่ทราบ')) echo 'style="visibility:hidden;"';?>  maxlength="10" value="<?php if(isset($telephone_network)) echo $telephone_network; ?>" /></td>
                  </tr>
                  <tr style="height: 10px;">
                    <td align="right" ></td>
                    <td align="left"></td>
                  </tr>
        </table>
                    
                    </td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><img src="<?=site_url()?>images/registerstudy_increase_20_03.jpg" width="739" height="36" alt="" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
      			<td align="right" style="padding-right:100px;">
      				<a href="javascript:validateForm();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','<?=site_url()?>images/registerstudy_increaseroll_24.jpg',1)"><img src="<?=site_url()?>images/registerstudy_increase_24.jpg" name="Image21" width="89" height="55" border="0" id="Image21" /></a>
      			</td>
   		  </tr>
        </table></form>
                </td>
              </tr>
              </table></td>
          </tr>
          </table></td>
        <td width="90" height="1596"><img src="<?=site_url()?>images/registerstudy_18.jpg" width="90" height="2500" alt="" /></td>
      </tr>
    </table>